// +----------------------------------------------------------------------
// | CRMEB [ CRMEB赋能开发者，助力企业发展 ]
// +----------------------------------------------------------------------
// | Copyright (c) 2016~2023 https://www.crmeb.com All rights reserved.
// +----------------------------------------------------------------------
// | Licensed CRMEB并不是自由软件，未经许可不能去掉CRMEB相关版权
// +----------------------------------------------------------------------
// | Author: CRMEB Team <admin@crmeb.com>
// +----------------------------------------------------------------------

import request from '@/libs/request';

/**
 * 获取列表数据
 * @param params
 * @return {*}
 */
export function getMerchantListApi(params) {
    return request({
        url: 'crud/merchant',
        method: 'get',
        params,
    });
}

/**
 * 获取添加表单数据
 * @return {*}
 */
export function getMerchantCreateApi() {
    return request({
        url: 'crud/merchant/create',
        method: 'get',
    });
}

/**
 * 添加数据
 * @param data
 * @return {*}
 */
export function merchantSaveApi(data) {
    return request({
        url: 'crud/merchant',
        method: 'post',
        data
    });
}

/**
 * 获取编辑表单数据
 * @param id
 * @return {*}
 */
export function getMerchantEditApi(id) {
    return request({
        url: `crud/merchant/${id}/edit`,
        method: 'get'
    });
}

/**
 * 修改数据
 * @param id
 * @return {*}
 */
export function merchantUpdateApi(id, data) {
    return request({
        url: `crud/merchant/${id}`,
        method: 'put',
        data
    });
}

/**
 * 修改状态
 * @param id
 * @return {*}
 */
export function merchantStatusApi(id, data) {
    return request({
        url: `crud/merchant/status/${id}`,
        method: 'put',
        data
    });
}

/**
 * 删除数据
 * @param id
 * @return {*}
 */
export function merchantDeleteApi(id) {
    return request({
        url: `crud/merchant/${id}`,
        method: 'delete'
    });
}

/**
 * 获取数据
 * @param id
 * @return {*}
 */
export function getMerchantReadApi(id) {
    return request({
        url: `crud/merchant/${id}`,
        method: 'get'
    });
}


/**
 * @description 已发布管理--领取记录
 * @param id
 * @param params
 */
export function shopAccountLogApi(params) {
    return request({
        url: `settlement/shop_account_log`,
        method: 'get',
        params,
    });
}

export function shopSettlementApi( params) {
    return request({
        url: `settlement/shop_settlement`,
        method: 'get',
        params,
    });
}
export function ShopSettlementRecordApi(params) {
    return request({
        url: `settlement/shop_settlement_record`,
        method: 'get',
        params,
    });
}

/**
 * 获取编辑表单金额数据
 * @param id
 * @return {*}
 */
export function getMerchantEditOtherApi(id) {
    return request({
        url: `crud/merchant/${id}/get_edit_other`,
        method: 'get'
    });
}
